


<!DOCTYPE html>
<html>

<head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>H+ 后台主题UI框架 - 空白页</title>
    <meta name="keywords" content="">
    <meta name="description" content="">

   <link rel="shortcut icon" href="__STATIC__/layout/favicon.ico">
     <link href="__STATIC__/layout/css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
    <link href="__STATIC__/layout/css/font-awesome.css?v=4.4.0" rel="stylesheet">
     <!-- jqgrid-->
    <link href="__STATIC__/layout/css/animate.css" rel="stylesheet">
    <link href="__STATIC__/layout/css/style.css?v=4.1.0" rel="stylesheet">
    <link href="__STATIC__/layout/css/plugins/sweetalert/sweetalert.css" rel="stylesheet">
    <link href="__STATIC__/layout/css/gyq.css" rel="stylesheet">
    <link rel="stylesheet" href="__STATIC__/layout/css/demo.css" type="text/css">
    <style>
            .checkbox-inline input[type=checkbox],.radio-inline input[type=radio] {
    margin-top: 4px;
}
    </style>
</head>

<body style="color:#333;padding:3px;">
    <!-- 标题 -->
    <div class="page-heade">
        <h2 class="title_color text-center">系统营销费用报表</h2>
    </div>
    <!-- 标题 -->
    <div>
    <form action="{:url('query')}"  class="form-inline" id="f1">
      <table class="tab-content table-bordered  table" border="1" style="margin-bottom:1px">
          <tr>
          <td style="min-width:120px;width: 120px " class="text-center">财年：</td>
          <td>
             <select name="cid" id="cid" class="select form-control">
                 {volist name="cainian" id="c"}
                  <option value="{$c.id}" {if $cid==$c.id} selected {/if}>{$c.title}</option>
                 {/volist}
          </select>
            <span class="lr_5"></span>
           <div class="form-group">
               <label class="radio-inline" for="formalFx">
                    <input type="radio" checked name="fx_kind" id="chang" value="1">常规分析
               </label>
               <label class="radio-inline" for="kind_zb">
                 <input type="radio" name="fx_kind" id="kemus"  value="2">各费用科目占比
               </label>
                      
            </div>
            </td>
      </tr>
      <tr>
         <td class="text-center">分区：</td>
         <td>
            <select name="fenqu" id="fenqu" class="select form-control">
        <option value="0">请选择</option>
        {volist name="fenqu" id="c"}
          <option value="{$c.id}">{$c.title}</option>
        {/volist}
      </select>
         </td>
      </tr>
       <tr>
         <td class="text-center">省份：</td>
         <td>
           <select name="provice" id="province" class="select form-control">
        <option value="0">请选择</option>
        
      </select>
         </td>
      </tr>
        <tr>
         <td class="text-center">城市：</td>
         <td>
            <select name="city" id="city" class="select form-control">
                <option value="0">请选择</option>
            </select>
         </td>
      </tr>
       <tr>
         <td class="text-center">经销商：</td>
         <td>
            <select name="jxs" id="jxs" class="select form-control">
                <option value="0">请选择</option>
            </select>
         </td>
      </tr>
      <tr id="kind_lx" style="display: none;">
        <td class="text-center">费用科目：</td>
         <td>
            <div class="form-group">
                    {volist name="kemu" id="k"}
                  <span class="checkDiv">
                    <label class="checkbox-inline" for="dtf">
                         <input type="checkbox" name="kemu[]" class="kemu"   value="{$k.id}">{$k.title}
                    </label>
                  </span>
                {/volist}
                 <button class="btn-info btn" type="button" id="checkAll1">全选</button>
                 <button class="btn-info btn" type="button" id="cancelCheckAll1">取消全选</button>
            </div>
          </td>
      </tr>
      </table>
   
     <div class="padding-10 text-center">
        <button class="btn btn-info" type="submit">查询</button>
     </div>
</form>
    </div>
    <!-- 全局js -->
    <script src="__STATIC__/layout/js/jquery.min.js?v=2.1.4"></script>
    <script src="__STATIC__/layout/js/bootstrap.min.js?v=3.3.6"></script>
    <!-- <script src="js/plugins/metisMenu/jquery.metisMenu.js"></script> -->
    <script src="__STATIC__/layout/js/plugins/slimscroll/jquery.slimscroll.min.js"></script>
     <script src="__STATIC__/layout/js/plugins/layer/laydate/laydate.js"></script>
    <script src="__STATIC__/layout/js/plugins/sweetalert/sweetalert.min.js"></script>

      <script src="__STATIC__/layout/js/common.js"></script>
    <script>
    //查询验证
              document.getElementById("f1").onsubmit=function(){
                if($("#fenqu").val()==0){
                  swal("请至少选择一个分区")
                  return false;
                }else if($("#province").val()==0){
                  swal("请至少选择一个省份")
                  return false;
                }else if($("#city").val()==0){
                  swal("请至少选择一个城市")
                  return false;
                }else if($("#jxs").val()==0){
                  swal("请至少选择一个经销商")
                  return false;
                }

                if($("#kemus").prop("checked")){
                   
                  if($(".kemu:checked").length==0){
                    swal("请至少选择一个科目")
                    return false;
                  }
                }else{
                   $(".kemu").prop("checked",false)
                }
              }
       $(document).ready(function(){
            var $ObjectNum =$(".ObjectNum");
               toNum($ObjectNum);
             });

    $("#fenqu").change(function(){
      var fid=$(this).val();
      $("#province").html('<option value="0">请选择</option>');
      $("#city").html('<option value="0">请选择</option>');
      $("#jxs").html('<option value="0">请选择</option>');
      $.post("{:url('fenqutosheng')}",{fid:fid},function(re){
          var data=JSON.parse(re);
          for(var i=0;i<data.length;i++){
            $("#province").append('<option value="'+data[i]["id"]+'">'+data[i]["title"]+'</option>')
          }
      })
    })
    $("#province").change(function(){
      var pid=$(this).val();
      $("#city").html('<option value="0">请选择</option>');
      $("#jxs").html('<option value="0">请选择</option>');
       $.post("{:url('shengtoshi')}",{pid:pid},function(re){
          var data=JSON.parse(re);
          for(var i=0;i<data.length;i++){
            $("#city").append('<option value="'+data[i]["id"]+'">'+data[i]["title"]+'</option>')
          }
      })
    })
    $("#city").change(function(){
      var cid=$(this).val();
      $("#jxs").html('<option value="0">请选择</option>');
      $.post("{:url('shitojxs')}",{cid:cid},function(re){
          var data=JSON.parse(re);
          for(var i=0;i<data.length;i++){
            $("#jxs").append('<option value="'+data[i]["id"]+'">'+data[i]["title"]+'</option>')
          }
      })
    })
       $(document).ready(function(){
            var $ObjectNum =$(".ObjectNum");
               toNum($ObjectNum);
             });

       /*常规分析 各费用占比*/
        $("[name='fx_kind']").change(function(){
          if($("#chang").prop("checked")){
            $("#kind_lx").hide();
          }else{
            $("#kind_lx").show();
          }
        })
        // /*fenqu全选*/
        //    $("#checkAll").click(function(){
      
        //        $("[name=items]:checkbox").prop("checked",true);
        //    })
        //    /*fenqu取消全选*/
        //   $("#cancelCheckAll").click(function(){
        //     $("[name=items]:checkbox").each(function(){
        //     $(this).prop("checked",!$(this).prop("checked"))
        //      })
           
        //    })
  /*kind_lx全选*/
              $("#checkAll1").click(function(){
      
               $(".kemu").prop("checked",true);
           })
           /*kind_lx取消全选*/
             $("#cancelCheckAll1").click(function(){
            $(".kemu").prop("checked",false)
           
           })

             /*查询*/
             $(".query").click(function(){
            
                    if($("#cainian").val()==0){
                      swal("","请选择财年！","error");

                    }else if($('#fenqu').val()==0){
                        swal("","请选择分区！","error");
                    }else if($('#province').val()==0){
                       swal("","请选择省份！","error");
                    }else if($('#city').val()==0){
                        swal("","请选择城市！","error");
                    }else if($('input[name=items1]:checked').length<1){
                       alert("请选择费用科目！")
                    }else{
                        location.href="{:url('Other/system_yx_costbtodetail')}"
                    }
              
                });
    </script>
</body>

</html>
